package com.qdlc.p2p.dal.dao.impl;

import org.springframework.stereotype.Repository;

import com.qdlc.p2p.common.constant.Global;
import com.qdlc.p2p.dal.common.dao.jpa.BaseDaoImpl;
import com.qdlc.p2p.dal.common.model.jpa.PageDataList;
import com.qdlc.p2p.dal.dao.CustomerDao;
import com.qdlc.p2p.dal.dto.Customer;
import com.qdlc.p2p.dal.model.CustomerModel;
/**
 * 
 * 类说明
 *
 * @author zlhx
 * @version 2.0
 * @date 2015年8月3日 下午3:05:47
 */
@Repository("customerDao")
public class CustomerDaoImpl extends BaseDaoImpl<Customer> implements CustomerDao {

	@Override
	public int modify(long id, int status) {
		String sql = "update " + Global.DB_PREFIX + "customer set status = :status where id = :id";
		String[] names = new String[] {"status","id"};
		Object[] values = new Object[] {status,id};
		return updateBySql(sql, names, values);
	}

	@Override
	public int delete(long id, int isDelete) {
		String sql = "update " + Global.DB_PREFIX + "customer set is_delete = :isDelete where id = :id";
		String[] names = new String[] {"isDelete","id"};
		Object[] values = new Object[] {isDelete,id};
		return updateBySql(sql, names, values);
	}

	@Override
	public PageDataList<CustomerModel> userList(CustomerModel model) {
		return null;
	}
	
}
